<link rel="stylesheet" type="text/css" href="<?= base_url() ?>file/js/easyui/themes/gray/easyui.css"> 
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>file/js/easyui/themes/icon.css">
<link rel="stylesheet" href="<?= base_url() ?>file/js/jquery-ui-1.8.17.custom/development-bundle/themes/ui-lightness/jquery.ui.all.css">

<h2>Uplaod MFino</h2>

<?php if($error) { ?>
	<div class="error-box">
		<img src="<?=base_url()?>file/images/cross.png" alt="close" class="tutup"/>
		<?php echo $error; ?>
		Maybe you want to view <a href="<?=base_url()?>index.php/master/mfino">uploaded Mfino</a>
	</div>
<?php } ?>
<?php 
	echo form_open_multipart('index.php/upload/mfino', 'id="upload-mfino" '); 
	echo form_upload('mfino-csv', '', 'id="file-name"');
?>
<!-- <textarea name="query-eload" id="query" class="query" cols="100" rows="8"> </textarea> -->
<p>Delimiter (pemisah)</p>
<p>
<?php 
	echo form_radio('delimiter', ',', TRUE, 'id="comma"');
	echo form_label('Koma (,)', 'comma');
	echo form_radio('delimiter', ';', '', 'id="semicolon"');
	echo form_label('Titik koma (;)', 'semicolon');
?>
</p>
<hr/>
<div id="f1_upload_process">
      <p>Please, be patient while your data being insert into database
      <p id="progressbar"></p>
</div>
<?php 
	echo form_submit('', 'Execute Query', 'id="execute" onClick="startUpload()"');
	echo form_reset('', 'Cancel', 'id="cancel"');
?>
<!-- <iframe id="upload_target" name="upload_target" src="#" style="width:0;height:0;border:0px solid #fff;"></iframe> -->
<?php echo form_close(); ?>


<script type="text/javascript">
$(document).ready(function(){

      $('#progressbar').hide();
      $('#f1_upload_process').dialog({ 
            dialogClass: "alert" ,
            height: '100',
            draggable: false,
            modal: true,
            resizable: false,
            autoOpen: false
      });
      $( "#progressbar" ).progressbar({value: 100});
      $('.tutup').click(function(){
            $('.error-box').hide('slow');
      });
});

function startUpload(){
      $('.error-box').hide('slow');
      $('#f1_upload_process').dialog('open');
      $('#progressbar').show();
      return true;
}

</script>
